// JORGE FERNANDO GOMEZ
// 1259371
// 189631
// LEC A1
// MARTIN MÜLLER
// D02
// YANG LIU


#ifndef KEYBOARDAGENT_H
#define KEYBOARDAGENT_H 1

#include "hash.h"

#define DISP_SIZE 10


/* Struct to store default input.
 * Can be changed. */
struct __defaultInput {
    int left, right;
    int thrust;
};

typedef void (*inputAction)(void);

/* This struct holds a function pointer which
 * represents a lander action after a key is
 * pressed by the user. */
struct __LanderActions {
    inputAction doAction;
};


typedef struct __LanderActions LActions;
typedef LActions * LAction;

extern LActions LanderActionLeft, LanderActionRight,
       LanderActionThrust, LanderActionDefault;

typedef struct __defaultInput KBInput;
extern KBInput DefaultInput;


/* See ./keyboardagent.h for more information. */
/* Function prototypes. */

void initDispatchTable ( void );
hash* getDispatchTable ( void );

void setDefaultActions ( void );
int getInput ( void );

void setLanderControl ( char * name );
char* getLanderControlName ( void );

void computeLeft ( void );
void computeRight ( void );
void computeThrust ( void );

void printUsage ( void );

#endif /* end of include guard: KEYBOARDAGENT_H */
